package com.miao.im.filter;

import com.miao.im.common.Message;
import com.miao.im.server.session.SessionContext;

/**
 * @Auther: miaoguoxin
 * @Date: 2021/3/2 09:43
 * @Description:
 */
public abstract class AbstractMessageFilter implements Comparable<AbstractMessageFilter> {

    public int order() {
        return 0;
    }

    public abstract boolean doFilter(Message message, SessionContext sessionContext);

    @Override
    public int compareTo(AbstractMessageFilter o) {
        return order() - o.order();
    }
}
